|
Menu location |
---|
Drafting → B-spline 2D Drafting → B-spline |
Workbenches |
Draft, BIM |
Default shortcut |
B S |
Introduced in version |
0.7 |
See also |
Draft Wire, Draft CubicBezCurve, Draft BezCurve |
The Draft BSpline command creates a B-spline curve from several points.
The Draft BSpline command specifies the exact points through which the curve will pass. The Draft BezCurve and the Draft CubicBezCurve commands, on the other hand, use control points to define the position and curvature of the spline.
Spline defined by multiple points
See also: Draft Tray, Draft Snap and Draft Constrain.
The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts (for version 1.0).
true
and will have a filled face, provided it is closed and does not self-intersect. Note that a self-intersecting spline with a face will not display properly, for such a spline DadosMake Face must be set to false
.
See also: Property editor.
A Draft BSpline object is derived from a Part Part2DObject and inherits all its properties. It also has the following additional properties:
Draft
Area
): (read-only) specifies the area of the face of the spline. The value will be 0.0
if DadosMake Face if false
or the face cannot be created.Bool
): specifies if the spline is closed or not. If the spline is initially open this value is false
, setting it to true
will draw a curve segment to close the spline. If the spline is initially closed this value is true
, setting it to false
will remove the last curve segment and make the spline open.Bool
): specifies if the spline makes a face or not. If it is true
a face is created, otherwise only the perimeter is considered part of the object. This property only works if DadosClosed is true
and if the spline does not self-intersect.Float
): affects the shape of the spline.VectorList
): specifies the points of the spline in its local coordinate system.
Draft
Length
): specifies the size of the symbol displayed at the end of the spline.Enumeration
): specifies the type of symbol displayed at the end of the spline, which can be Dot
, Circle
, Arrow
, Tick
or Tick-2
.Bool
): specifies whether to show a symbol at the end of the spline, so it can be used as an annotation line.Enumeration
): specifies the Draft Pattern with which to fill the face of the closed spline. This property only works if DadosMake Face is true
and if VistaDisplay Mode is Flat Lines
.Float
): specifies the size of the Draft Pattern.See also: Autogenerated API documentation and FreeCAD Scripting Basics.
To create a Draft BSpline use the make_bspline
method (introduced in version 0.19) of the Draft module. This method replaces the deprecated makeBSpline
method.
bspline = make_bspline(pointslist, closed=False, placement=None, face=None, support=None)
bspline = make_bspline(Part.Wire, closed=False, placement=None, face=None, support=None)
bspline
object from the given list of points, pointslist
.
FreeCAD.Vector
, with units in millimeters.Part.Wire
, from which points are extracted.closed
is True
, or if the first and last points are identical, the spline is closed.placement
is None
the spline is created at the origin.face
is True
, and the spline is closed, the spline will make a face, that is, it will appear filled.Example:
import FreeCAD as App
import Draft
doc = App.newDocument()
p1 = App.Vector(0, 0, 0)
p2 = App.Vector(1000, 1000, 0)
p3 = App.Vector(2000, 0, 0)
spline1 = Draft.make_bspline([p1, p2, p3], closed=False)
spline2 = Draft.make_bspline([p1, 2*p3, 1.3*p2], closed=False)
spline3 = Draft.make_bspline([1.3*p3, p1, -1.7*p2], closed=False)
doc.recompute()